package com.woniuxy.controller;

import com.woniuxy.entity.RbacMenu;
import com.woniuxy.service.MenuService;
import com.woniuxy.utils.Resout;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
@RestController
@RequestMapping("/menu")
public class MenuController {
    @Autowired(required = false)
    MenuService menuService;
    @GetMapping("/getAll")
    public Resout getAll(){
        return menuService.getAll();
    }
    @PostMapping("/findSon/{id}")
    public Resout findSon(@PathVariable("id") int fid){
        return menuService.findSon(fid);
    }
    @PostMapping("/save")
    public Resout save(@RequestBody RbacMenu rbacMenu){
        return menuService.save(rbacMenu);
    }
}
